package com.ywu.bpmn.flow.data;

import com.ywu.bpmn.flow.dto.YwuFlowInstanceCommonDto;
import com.ywu.bpmn.flow.entity.YwuFlowInstanceEntity;
import com.ywu.bpmn.flow.entity.YwuFlowTaskEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface YwuFlowInstanceRepository {
    void insert(@Param("model")YwuFlowInstanceEntity entity);

    void updateFlowStatus(@Param("model")YwuFlowInstanceEntity entity);

    void updateFlowStatusAndCurrentNode(@Param("model")YwuFlowInstanceEntity entity);

    YwuFlowInstanceEntity getInstanceById(@Param("model")YwuFlowInstanceEntity entity);

    List<YwuFlowInstanceCommonDto> queryFlowTodoList(@Param("model") YwuFlowInstanceCommonDto entity);

    List<YwuFlowInstanceCommonDto> queryInstanceTodoList(@Param("model") YwuFlowInstanceCommonDto entity);

    YwuFlowInstanceCommonDto queryInstanceDetailInfo(@Param("model") YwuFlowInstanceCommonDto entity);

    void insertTask(@Param("model") YwuFlowTaskEntity ywuFlowTaskEntity);

    void updateTaskStatus(@Param("model") YwuFlowTaskEntity ywuFlowTaskEntity);

    void updateCurrentNode(@Param("model") YwuFlowInstanceEntity updateCurrentNode);

    YwuFlowTaskEntity getTaskInfoByInstanceIdAndAssignee(@Param("model") YwuFlowTaskEntity entity);

    YwuFlowInstanceCommonDto getInstanceAndFlowInfoByInstanceId(@Param("model") YwuFlowInstanceEntity searchInstance);
}
